package mobi.greenplate.client.domain;

import java.io.Serializable;
import java.util.Date;

public class RequestRide implements Serializable {

    private static final long serialVersionUID = 1L;
    private Long id;
    private RideState rideState;
    private User requester;
    private Address startAddress;
    private Address endAddress;
    private Date startTime;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public RideState getRideState() {
        return rideState;
    }

    public void setRideState(RideState rideState) {
        this.rideState = rideState;
    }

    public User getRequester() {
        return requester;
    }

    public void setRequester(User requester) {
        this.requester = requester;
    }

    public Address getStartAddress() {
        return startAddress;
    }

    public void setStartAddress(Address startAddress) {
        this.startAddress = startAddress;
    }

    public Address getEndAddress() {
        return endAddress;
    }

    public void setEndAddress(Address endAddress) {
        this.endAddress = endAddress;
    }

    public Date getStartTime() {
        return startTime;
    }

    public void setStartTime(Date startTime) {
        this.startTime = startTime;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final RequestRide other = (RequestRide) obj;
        if (this.id != other.id && (this.id == null || !this.id.equals(other.id))) {
            return false;
        }
        if (this.rideState != other.rideState) {
            return false;
        }
        if (this.requester != other.requester && (this.requester == null || !this.requester.equals(other.requester))) {
            return false;
        }
        if (this.startAddress != other.startAddress && (this.startAddress == null || !this.startAddress.equals(other.startAddress))) {
            return false;
        }
        if (this.endAddress != other.endAddress && (this.endAddress == null || !this.endAddress.equals(other.endAddress))) {
            return false;
        }
        if (this.startTime != other.startTime && (this.startTime == null || !this.startTime.equals(other.startTime))) {
            return false;
        }
        return true;
    }

    @Override
    public int hashCode() {
        int hash = 7;
        hash = 29 * hash + (this.id != null ? this.id.hashCode() : 0);
        hash = 29 * hash + (this.rideState != null ? this.rideState.hashCode() : 0);
        hash = 29 * hash + (this.requester != null ? this.requester.hashCode() : 0);
        hash = 29 * hash + (this.startAddress != null ? this.startAddress.hashCode() : 0);
        hash = 29 * hash + (this.endAddress != null ? this.endAddress.hashCode() : 0);
        hash = 29 * hash + (this.startTime != null ? this.startTime.hashCode() : 0);
        return hash;
    }

    @Override
    public String toString() {
        return "RequestRide{" + "id=" + id + "rideState=" + rideState + "requester=" + requester + "startAddress=" + startAddress + "endAddress=" + endAddress + "startTime=" + startTime + '}';
    }
}
